//Cristian Moral Martos

package Ejercicio10;

import utils.ImagePGM;

/**
 * 
 * Exercise 10.1 Implement the following function to compute the number of flat
 * zones of an input image:
 * 
 * imFlatZonesNumber (imageIn, conectividad) // result: number of flat zones
 * 
 * Note: internally, an auxiliary image of sufficient bit depth (16 bits or,
 * better, 32 bits) should be used
 * 
 * Note: 8-connectivity can be assumed.
 * 
 * 
 * To check imFlatZonesNumber: (a) immed_gray_inv_20051218_thresh127.pgm has 55
 * flat zones with 8-connectivity (with 4-connectivity, the number of flat zones
 * is also 55). (b) the gray-level image immed_gray_inv.pgm has 12488 flat zones
 * with 8-connectivity (with 4-connectivity, 16909 flat zones).
 * 
 */
public class Ejercicio101 {

	public static void main(String[] args) {
		// Input image to treat
		String pathInputImage = "input\\immed_gray_inv_20051218_thresh127.pgm";
		ImagePGM inputImage = new ImagePGM(pathInputImage);
		System.out.println("La imagen " + pathInputImage + " tiene "
				+ inputImage.getNumberFlatZones() + " regiones (flat zones).");

		String pathInputImage2 = "input\\immed_gray_inv.pgm";
		ImagePGM inputImage2 = new ImagePGM(pathInputImage2);
		System.out.println("La imagen " + pathInputImage2 + " tiene "
				+ inputImage2.getNumberFlatZones() + " regiones (flat zones).");
	}
}
